Adds func for creating V2 beholder auth headers#1640
Merged
vyzaldysanchez merged 3 commits intomainfrom Oct 23, 2025
Merged
Conversation
✅ API Diff Results - No breaking changes |
kirqz23
approved these changes
Oct 22, 2025
jmank88
approved these changes
Oct 22, 2025
pkcll
reviewed
Oct 22, 2025
| require.NoError(t, err) | ||
|
|
||
| // Verify the signature | ||
| valid := ed25519.Verify(pubKey, msgBytes, signatureBytes) |
Contributor
There was a problem hiding this comment.
Should it verify signature against the header (parts[1], part[2]) not the msgBytes ?
Contributor
Author
There was a problem hiding this comment.
msgBytes is parts 1 & 2
pkcll
reviewed
Oct 22, 2025
| } | ||
|
|
||
| headers := make(map[string]string) | ||
| headers[authHeaderKey] = fmt.Sprintf("%s:%x:%d:%x", authHeaderV2, pubKey, ts.UnixNano(), signature) |
Contributor
There was a problem hiding this comment.
For timestamps before the Unix epoch (pre-1970), ts.UnixNano() is negative.
In practice we should not get those but for consistency its better to use same uint64 value for both signature and header
Suggested change
| headers[authHeaderKey] = fmt.Sprintf("%s:%x:%d:%x", authHeaderV2, pubKey, ts.UnixNano(), signature) | |
| headers[authHeaderKey] = fmt.Sprintf("%s:%x:%d:%x", authHeaderV2, pubKey, uint64(ts.UnixNano()), signature) |
pkcll
approved these changes
Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
V2version of auth headersrotatingAuthto us funcWhy